package com.vrv.app.cyberspace.modules.sys.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.vrv.app.cyberspace.common.utils.JSONResult;
import com.vrv.app.cyberspace.modules.sys.entity.EventTypeTable;
import com.vrv.app.cyberspace.modules.sys.mapper.EventTypeTableMapper;
import com.vrv.app.cyberspace.modules.sys.service.IEventTypeTableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import static com.vrv.app.cyberspace.common.utils.JSONResult.renderSuccess;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author sm
 * @since 2017-12-15
 */
@SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
@Service
@Transactional
public class EventTypeTableServiceImpl extends ServiceImpl<EventTypeTableMapper, EventTypeTable> implements IEventTypeTableService {
    @Autowired
    private EventTypeTableMapper eventTypeTableMapper;

    @Override
    public JSONResult getListEventType(Integer parentID) {
        EntityWrapper<EventTypeTable> ew = new EntityWrapper<>();
        ew.eq("parentID", parentID);
        ew.orderBy("id", true);
        return renderSuccess(eventTypeTableMapper.selectList(ew));
    }
}
